﻿@{
    Ajax.Dna().Widget()
        .Content(@<text>
    @if ((Request.Url.Authority.StartsWith("localhost", StringComparison.OrdinalIgnoreCase)) ||
         (Request.Url.Authority.Equals("127.0.0.1", StringComparison.OrdinalIgnoreCase)))
    {
        <div style="padding: 10px;">
            @Html.Global("tmpl","AdNotAvailable")</div>
    }
    else
    {
        if ((!string.IsNullOrEmpty(item.GetString("SlotID"))) && (!string.IsNullOrEmpty(item.GetString("ClientCode"))))
        {
        <div style="text-align: center;">
            <script type="text/javascript"><!--
                           google_ad_client ='@item.GetString("ClientCode")';
                           google_ad_slot ='@item.GetString("SlotID")';
                           google_ad_width =@item.GetInt("AdWidth");
                           google_ad_height =@item.GetInt("AdHeight");
                     //--></script>
            <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
        </div>
        }
        else
        {
        <div style="padding: 10px;">
            @Html.Global("AdSence_Empty")
        </div>
        }
    }
    </text>)
.Preview(@<text>
        <i>Sample</i>
        <table border="0" cellpadding="0" cellspacing="0" class="adc">
            <tbody>
                <tr>
                    <td valign="middle">
                        <a style="font-size: 13px;font-weight: bold;line-height: normal;color:Blue;" href="#" title="www.ad-url.com"><span>Ad Title</span></a>
                        <div  style="color: black;font-size: 12px;line-height: normal;">
                            <span>Ad Text (This text will generate from google adsense.)</span>
                        </div>
                        <div style="color: green;font-size: 10px;line-height: normal;overflow: hidden;text-decoration: underline;text-overflow: ellipsis;white-space: nowrap;">
                            <span style="color: green;font-size: 10px;line-height: normal;white-space: nowrap;" title="www.ad-url.com">www.ad-url.com</span></div>
                    </td>
                </tr>
            </tbody>
        </table>        
</text>)
        .Render();
}
